<?php
/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The Latitude service implementation
 *
 * Generated by http://code.google.com/p/google-api-php-client/
 * Generated from: http://www.googleapis.com/discovery/0.1/describe?api=latitude&apiVersion=v1
 **/
class apiLatitudeService {

  // Variables that the apiServiceResource implementation depends on
  private $serviceName = 'latitude';
  private $version = 'v1';
  private $baseUrl = 'https://www.googleapis.com/';
  private $io;
  // apiServiceResource's that are used internally
  private $location;
  private $currentLocation;

  /**
   * Constructs the internal service representations and does the auto-magic configuration required to drive them
   */
  public function __construct(apiClient $apiClient) {
    $apiClient->addService('latitude', 'v1');
    $this->io = $apiClient->getIo();
    $this->location = new apiServiceResource($this, $this->serviceName, 'location', json_decode('{"methods":{"insert":{"pathUrl":"latitude\/v1\/location","rpcName":"latitude.location.insert","httpMethod":"POST","methodType":"rest"},"list":{"pathUrl":"latitude\/v1\/location","rpcName":"latitude.location.list","httpMethod":"GET","methodType":"rest","parameters":{"max-time":{"parameterType":"query","required":false},"min-time":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"granularity":{"parameterType":"query","required":false}}},"get":{"pathUrl":"latitude\/v1\/location\/{locationId}","rpcName":"latitude.location.get","httpMethod":"GET","methodType":"rest","parameters":{"granularity":{"parameterType":"query","required":false},"locationId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"delete":{"pathUrl":"latitude\/v1\/location\/{locationId}","rpcName":"latitude.location.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"locationId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->currentLocation = new apiServiceResource($this, $this->serviceName, 'currentLocation', json_decode('{"methods":{"insert":{"pathUrl":"latitude\/v1\/currentLocation","rpcName":"latitude.currentLocation.insert","httpMethod":"POST","methodType":"rest"},"delete":{"pathUrl":"latitude\/v1\/currentLocation","rpcName":"latitude.currentLocation.delete","httpMethod":"DELETE","methodType":"rest"},"get":{"pathUrl":"latitude\/v1\/currentLocation","rpcName":"latitude.currentLocation.get","httpMethod":"GET","methodType":"rest","parameters":{"granularity":{"parameterType":"query","required":false}}}}}', true));
  }

  /**
   * Implementation of the latitude.location.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.location.insert
   *
   * @param $postBody required
   */
  public function insertLocation($postBody) {
    return $this->location->__call('insert', array(array('postBody' => $postBody)));
  }

  /**
   * Implementation of the latitude.location.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.location.list
   *
   * @param $max_time optional
   * @param $min_time optional
   * @param $max_results optional
   * @param $granularity optional
   */
  public function listLocation($max_time = null, $min_time = null, $max_results = null, $granularity = null) {
    return $this->location->__call('list', array(array('max-time' => $max_time, 'min-time' => $min_time, 'max-results' => $max_results, 'granularity' => $granularity)));
  }

  /**
   * Implementation of the latitude.location.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.location.get
   *
   * @param $locationId required
   * @param $granularity optional
   */
  public function getLocation($locationId, $granularity = null) {
    return $this->location->__call('get', array(array('locationId' => $locationId, 'granularity' => $granularity)));
  }

  /**
   * Implementation of the latitude.location.delete method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.location.delete
   *
   * @param $locationId required
   */
  public function deleteLocation($locationId) {
    return $this->location->__call('delete', array(array('locationId' => $locationId)));
  }

  /**
   * Implementation of the latitude.currentLocation.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.currentLocation.insert
   *
   * @param $postBody required
   */
  public function insertCurrentLocation($postBody) {
    return $this->currentLocation->__call('insert', array(array('postBody' => $postBody)));
  }

  /**
   * Implementation of the latitude.currentLocation.delete method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.currentLocation.delete
   *
   */
  public function deleteCurrentLocation() {
    return $this->currentLocation->__call('delete', array(array()));
  }

  /**
   * Implementation of the latitude.currentLocation.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#latitude.currentLocation.get
   *
   * @param $granularity optional
   */
  public function getCurrentLocation($granularity = null) {
    return $this->currentLocation->__call('get', array(array('granularity' => $granularity)));
  }

  /**
   * @return the $io
   */
  public function getIo() {
    return $this->io;
  }

  /**
   * @param $io the $io to set
   */
  public function setIo($io) {
    $this->io = $io;
  }

  /**
   * @return the $version
   */
  public function getVersion() {
    return $this->version;
  }

  /**
   * @return the $baseUrl
   */
  public function getBaseUrl() {
    return $this->baseUrl;
  }

  /**
   * @param $version the $version to set
   */
  public function setVersion($version) {
    $this->version = $version;
  }

  /**
   * @param $baseUrl the $baseUrl to set
   */
  public function setBaseUrl($baseUrl) {
    $this->baseUrl = $baseUrl;
  }
    
}

